package com.xqls.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xqls.bean.WastegasSamplingBean;
import com.xqls.dal.dao.WastegasSamplingDao;
import com.xqls.dal.model.WastegasSampling;
import com.xqls.service.WastegasSamplingService;
import com.xqls.util.ObjectUtil;
@Service 
public class WastegasSamplingServiceImpl implements WastegasSamplingService{

	@Autowired private WastegasSamplingDao samplingDao;
	@Override
	public boolean insertWastegasSampling(WastegasSamplingBean wastegasSamplingBean) {
		WastegasSampling sampling = (WastegasSampling) ObjectUtil.transfer(wastegasSamplingBean, WastegasSampling.class);

		return samplingDao.insertWastegasSamplingList(sampling)>0;
	}

	@Override
	public List<Map<String, Object>> selectByMap(Map<String, Object> map) {
		return samplingDao.selectByMap(map);
	}

	@Override
	public boolean updateWastegasSampling(WastegasSamplingBean wastegasSamplingBean) {
		WastegasSampling sampling = (WastegasSampling) ObjectUtil.transfer(wastegasSamplingBean, WastegasSampling.class);
		return samplingDao.updateWastegasSamplingList(sampling)>0;
	}

	@Override
	public WastegasSampling queryRecordByDeviceNo(String deviceNo) {
		return samplingDao.queryRecordByDeviceNo(deviceNo);
	}

}
